package com.chilli.cosima.data.dao;

import java.util.List;
import java.util.Map;

import com.chilli.cosima.common.BussinessException;
import com.chilli.cosima.data.bean.TOperator;
import com.chilli.cosima.data.bean.TPower;
import com.chilli.cosima.data.bean.TPowerRole;
import com.chilli.cosima.data.bean.TRole;

public interface UserDAO
{
	public Long createUser(TOperator user);

	public void deleteUser(Long[] id);

	public void updateUser(TOperator id);

	public Object findUserById(Long id);

	public List<TOperator> findUserByRoleId(Long roleId);

	public List<TOperator> findUserByName(String username);

	public List<TOperator> findUserAll();

	@SuppressWarnings("unchecked")
	public Map findUserByPage(int current, int pageSize);

	@SuppressWarnings("unchecked")
	public Map findRoleByPage(int current, int pageSize);

	public List<TRole> findAllRoles();

	public String findRoleNameById(long roleid);

	public TRole findRoleByName(String rolename);

	public List<TPower> findAllPowers();

	public Long createRole(TRole role);

	public Long createPowerRole(TPowerRole powerrole);

	public void deleteRole(Long[] id);

	public void deleteRolePower(Long[] id);

	public void updateRole(TRole role) throws BussinessException;

	public TRole findRoleById(long roleid);

	public List<TPowerRole> findRolePowerByRoleId(Long roleid);
}
